<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P94 5.3.1 为什么使用构造函数</title>
</head>

<body>
    <script>
        function factory(name, age) {
            var o = {};
            o.name = name;
            o.age = age;
            return o;
        }
        var o1 = factory('Jack', 18);
        var o2 = factory('Alice', 19);
        console.log(o1);
        console.log(o2);
    </script>
    <a href="../首页/page05.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>